package com.promote.algorithm;

/**
 * @ClassName FindTheDifference
 * Description 找不同--力扣389
 * @Author LiZiHao
 * Date 2021/10/18 11:14
 * @Version 1.0
 **/
public class FindTheDifference {

    public static char findTheDifference(String s, String t) {

        int ret = 0;
        for (int i = 0; i < s.length(); ++i) {
            ret ^= s.charAt(i);
        }
        for (int i = 0; i < t.length(); ++i) {
            ret ^= t.charAt(i);
        }
        return (char) ret;

    }

    public static void main(String[] args) {
        String s = "abcd";
        String t = "abcde";

        char theDifference = findTheDifference(s, t);
        System.out.println(theDifference);

    }
}
